This invention relates to the register organization within the central processing unit of a computer. A typical prior art computer contains a number of registers within the central processing unit for the temporary storage of data. Such registers have extremely fast access times so that data stored therein can be operated on by the central processing unit at an extremely fast rate. Registers differ from computer memory in that memory lies outside the central processing unit and has slower access times. Thus, a read or write operation to or from a register requires less time than the same operation for a memory location. For example, a register-to-memory data transfer is typically on the order of five times slower than a register-to-register data transfer.
A typical prior art computer has a single register bank of general purpose registers and a number of special purpose registers also known as system and status registers. General purpose registers are generally available for any type of data storage and retrieval to a computer program currently being executed by the computer such as a word processing program or a financial spreadsheet program. Status registers are reserved for special data that indicates the status of various internal conditions of the computer. Examples of status registers are the program counter, which contains the address of the computer program currently being executed, and the processor status register, which contains data relating to the status of the central processing unit.
This single register bank of a typical prior art computer is used by many different programs, subroutines, and procedures, which are executed by the central processing unit (CPU) of the computer. The CPU can execute only one of these various programs at a time, and when one is being executed by the CPU, the single register bank is used to store data being operated on by the program. When one program needs to be executed by the computer and a different program is currently being executed, the current program needs to be interrupted and the contents of the register bank saved to memory so that the program to be executed can use the register bank. After the program is finished being executed, the original contents of the register bank are retrieved from memory and restored so that the original program can begin to be executed where it left off without losing any of its data. This saving to memory of the contents of the general purpose registers in the register bank as well as the restoration of the original contents of the general purpose registers from memory are referred to as "context switches" for purposes of this specification.
One application in which context switches are performed is in multi-user computer systems. In multi-user systems, several programs may be run on the computer "at the same time" on a round-robin basis. For example, the computer might execute a first user's program for a short period of time, then suspend the first user's program and run the second user's program for a short period of time, and so on. Since each user's program needs access to the single bank of general purpose registers, context switches are performed between the execution of one user's program and another.
There is a very real disadvantage in performing the context switches required by single register bank computers. In a context switch, the contents of the general purpose registers are either saved to memory or retrieved from memory. As explained above, register-to-memory transfers are time consuming, especially if there are a lot of general purpose registers that need to be saved or restored. In many state-of-the-art computers today, a pair of context switches takes on the order of 100 microseconds. If many context switches are required, the associated overhead time can bring a computer to its knees. Other applications in which the performance of context switches can have a disastrous effect upon the processing time of the computer include interrupt processing, and particularly interrupt processing relating to data communications.
In the above-described applications, in addition to performing context switches to save the contents of the general purpose registers, it is also necessary to save the contents of the special purpose registers, or status registers. For purposes of this specification, a "status switch" is defined to include an operation that stores the contents of the status registers to memory and an operation that retrieves from memory the original contents of the status registers. The status switches required in the above-described applications also contribute undesirably to the computer overhead time.
One approach to this problem of status switches involves the use of status registers intermingled among the general purpose registers of a single bank of registers. For example, in one register architecture, a single bank of registers is addressable by a sliding window which allows 15 general purpose registers and a single status register to be addressed at a time. The status registers, which are physically located within the bank of general purpose registers and associated with an equal number of windows of general purpose registers, are used to store the program counter, which specifies the particular instruction of the computer program currently being executed. The problem with this approach to storing status information is that status registers are physically intermingled with the general purpose registers. As a result, the status registers may be confused with the general purpose registers by an applications programmer.